#![allow(unused_variables)]

#[derive(Debug)]
struct CubeSat {
    id: u64, // 添加卫星结构体
}
#[derive(Debug)]
enum StatusMessage {
    Ok,
}
//获得cubesat所有权，结束时删除变量
fn check_status_bak(sat_id: CubeSat) -> StatusMessage {
    StatusMessage::Ok
}
//获得cubesat所有权，最后返回
fn check_status(sat_id: CubeSat) -> CubeSat {
    println!("{:?}: {:?}", sat_id, StatusMessage::Ok);
    sat_id
}

fn main() {
    let sat_a = CubeSat { id: 0 };
    let sat_b = CubeSat { id: 1 };
    let sat_c = CubeSat { id: 2 };

    let sat_a = check_status(sat_a);
    let sat_b = check_status(sat_b);
    let sat_c = check_status(sat_c);

    // "waiting" ...
    let a_status = check_status(sat_a); // 21行给了check_status函数
    let b_status = check_status(sat_b);
    let c_status = check_status(sat_c);
}
